package myschool.test2;

import myschool.dao.GradeDao;
import myschool.dao.StudentDao;
import myschool.entity.Grade;
import myschool.entity.Student;
import myschool.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class GradeTest {
    public static void main(String[] args) {
        SqlSession s= MybatisUtil.get();
        GradeDao mapper = s.getMapper(GradeDao.class);
        List<Grade> list = mapper.findAll();
        list.forEach(g->{
            System.out.println("年级信息如下："+g);
            System.out.println("年级学生：");
            g.getStus().forEach(System.out::println);
            System.out.println("***********************************");
        });
        MybatisUtil.close(s);
    }
}
